Order Method

The Order method controls the Z-order of a graphics item relative to other graphics items.

Example

; Create a deck of cards.

w = WINDOW()

x = [0,0.25,0.25,0]

y = [0,0,0.5,0.5]

r = OBJARR(20)

for i=0,19 do r[i] = POLYGON(x+i/30.,y+i/40.,FILL_COLOR=!COLOR.(i))

WAIT, 1

 

; Bring every other card forward by one.

for i=0,19,2 do r[i].Order, /BRING_FORWARD

WAIT, 1

 

; Send the same cards to the back.

for i=0,19,2 do r[i].Order, /SEND_TO_BACK

WAIT, 1

 

; Pick a card, any card.

card = (20*RANDOMU(seed,1))[0]

r[card].Order, /BRING_TO_FRONT

Syntax

graphic.Order [, /BRING_FORWARD] [, /BRING_TO_FRONT] [, /SEND_BACKWARD] [, /SEND_TO_BACK]

Arguments

None.

Keywords

BRING_FORWARD

Set this keyword to 1 to move the graphic item upwards in the viewing order.

BRING_TO_FRONT

Set this keyword to 1 to move the graphic item to the top of the viewing order (above all other items).

SEND_BACKWARD

Set this keyword to 1 to move the graphic item downwards in the viewing order.

SEND_TO_BACK

Set this keyword to 1 to move the graphic item to the bottom of the viewing order (below all other items).

Version History

8.0

Introduced

See Also

Select Method, Using IDL Graphics